/*
 * 组织/部门 API
 *
 * @author tqfeiyang
 * @since 2024-09-19
 */

import { postRequest, getRequest } from '/@/lib/axios';

export const departmentApi = {
    // 部门-分页查询
    getDepartmentPage(params) {
        return getRequest('@/api/business/organization/department/getDepartmentPage', params);
    },

    // 部门-获取全部
    getAllDepartmentList() {
        return getRequest('@/api/business/organization/department/getAllDepartmentList');
    },

    // 部门-获取详情
    getDepartmentInfo(departmentId) {
        return getRequest(`@/api/business/organization/department/getDepartmentInfo/${departmentId}`);
    },

    // 部门-添加
    createDepartment(data) {
        return postRequest('@/api/business/organization/department/createDepartment', data);
    },

    // 部门-修改
    updateDepartment(departmentId, data) {
        return postRequest(`@/api/business/organization/department/updateDepartment/${departmentId}`, data);
    },

    // 部门-删除
    deleteDepartment(departmentId) {
        return postRequest(`@/api/business/organization/department/deleteDepartment/${departmentId}`);
    },

    // 部门-批量删除
    batchDeleteDepartments(departmentIds) {
        return postRequest('@/api/business/organization/department/batchDeleteDepartments', departmentIds);
    },

    // 部门-导出Excel
    exportDepartmentExcel() {
        return getRequest('@/api/business/organization/department/exportDepartmentExcel');
    },

    // 部门-查询部门树
    getDepartmentTree() {
        return getRequest('@/api/business/organization/department/getDepartmentTree');
    },
};
